import { _decorator, Component } from 'cc';
import { SandBlast_GameStorage } from './Data/SandBlast_GameStorage';
import { SandBlast_GameData } from './Data/SandBlast_GameData';
import SandBlast_GamePanel from './SandBlast_GamePanel';

const { ccclass, property, executionOrder } = _decorator;

// // 慢一点执行
@ccclass('SandBlast_GameManager')
@executionOrder(101)
export default class SandBlast_GameManager extends Component {
    static Instance: SandBlast_GameManager;
    onLoad() {
        SandBlast_GameManager.Instance = this;

        SandBlast_GameStorage.initData();

        // console.log(`SandBlast_GameStorage.data`, SandBlast_GameStorage.data);

        this.Init();
    }

    Init() {
        SandBlast_GameData.InitData();

        this.scheduleOnce(() => {
            SandBlast_GamePanel.Instance.ShowOn();
        }, 0.01);
    }
}

// /** 调试 */
window["SandBlast_GameManager"] = SandBlast_GameManager;